Class Request

Summary

Fully Qualified Name: Laminas\Http\Request
Extends: AbstractMessage
Implements: RequestInterface

Description

HTTP Request

Methods

Name Description Defined By
__toString() Allow PHP casting of this object AbstractMessage
fromString() A factory that produces a Request object from a well-formed Http Request string Request
getAllowCustomMethods() Request
getContent() Get message content Message
getCookie() Return the Cookie header, this is the same as calling $request->getHeaders()->get('Cookie'); Request
getFiles() Return the parameter container responsible for file parameters or a single file. Request
getHeader() Get all headers of a certain name/type. Request
getHeaders() Return the header container responsible for headers or all headers of a certain name/type Request
getMetadata() Retrieve all metadata or a single metadatum as specified by key Message
getMethod() Return the method for this request Request
getPost() Return the parameter container responsible for post parameters or a single post parameter. Request
getQuery() Return the parameter container responsible for query parameters or a single query parameter Request
getUri() Return the URI for this request object Request
getUriString() Return the URI for this request object as a string Request
getVersion() Return the HTTP version for this request AbstractMessage
isConnect() Is this a CONNECT method request? Request
isDelete() Is this a DELETE method request? Request
isFlashRequest() Is this a Flash request? Request
isGet() Is this a GET method request? Request
isHead() Is this a HEAD method request? Request
isOptions() Is this an OPTIONS method request? Request
isPatch() Is this a PATCH method request? Request
isPost() Is this a POST method request? Request
isPropFind() Is this a PROPFIND method request? Request
isPut() Is this a PUT method request? Request
isTrace() Is this a TRACE method request? Request
isXmlHttpRequest() Is the request a Javascript XMLHttpRequest? Request
renderRequestLine() Return the formatted request line (first line) for this http request Request
setAllowCustomMethods() Request
setContent() Set message content Message
setFiles() Provide an alternate Parameter Container implementation for file parameters in this object, (this is NOT the primary API for value setting, for that see getFiles()) Request
setHeaders() Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders()) AbstractMessage
setMetadata() Set message metadata Message
setMethod() Set the method for this request Request
setPost() Provide an alternate Parameter Container implementation for post parameters in this object, (this is NOT the primary API for value setting, for that see getPost()) Request
setQuery() Provide an alternate Parameter Container implementation for query parameters in this object, (this is NOT the primary API for value setting, for that see getQuery()) Request
setUri() Set the URI/URL for this request, this can be a string or an instance of Laminas\Uri\Http Request
setVersion() Set the HTTP version for this object, one of 1.0, 1.1 or 2 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2) AbstractMessage
toString() Request

Method Details

__toString()

Allow PHP casting of this object

Returns: string

fromString()

A factory that produces a Request object from a well-formed Http Request string

Parameter Name Type Description
$string string
$allowCustomMethods bool

Returns: static

getAllowCustomMethods()

Returns: bool

getContent()

Get message content

Returns: mixed

getCookie()

Return the Cookie header, this is the same as calling $request->getHeaders()->get('Cookie');

Returns: \Header\Cookie|bool

getFiles()

Return the parameter container responsible for file parameters or a single file.

Parameter Name Type Description
$name string|null Parameter
$default mixed|null Default

Returns: \ParametersInterface|mixed

getHeader()

Get all headers of a certain name/type.

Parameter Name Type Description
$name string|null Header
$default mixed|null Default

Returns: \Laminas\Http\Headers|bool|\Laminas\Http\Header\HeaderInterface|\ArrayIterator

getHeaders()

Return the header container responsible for headers or all headers of a certain name/type

Parameter Name Type Description
$name string|null Header
$default mixed|null Default

Returns: \Laminas\Http\Headers|bool|\Laminas\Http\Header\HeaderInterface|\ArrayIterator

getMetadata()

Retrieve all metadata or a single metadatum as specified by key

Parameter Name Type Description
$key null|string|int
$default null|mixed

Returns: mixed

getMethod()

Return the method for this request

Returns: string

getPost()

Return the parameter container responsible for post parameters or a single post parameter.

Parameter Name Type Description
$name string|null Parameter
$default mixed|null Default

Returns: \ParametersInterface|mixed

getQuery()

Return the parameter container responsible for query parameters or a single query parameter

Parameter Name Type Description
$name string|null Parameter
$default mixed|null Default

Returns: \ParametersInterface|mixed

getUri()

Return the URI for this request object

Returns: \HttpUri

getUriString()

Return the URI for this request object as a string

Returns: string

getVersion()

Return the HTTP version for this request

Returns: string

isConnect()

Is this a CONNECT method request?

Returns: bool

isDelete()

Is this a DELETE method request?

Returns: bool

isFlashRequest()

Is this a Flash request?

Returns: bool

isGet()

Is this a GET method request?

Returns: bool

isHead()

Is this a HEAD method request?

Returns: bool

isOptions()

Is this an OPTIONS method request?

Returns: bool

isPatch()

Is this a PATCH method request?

Returns: bool

isPost()

Is this a POST method request?

Returns: bool

isPropFind()

Is this a PROPFIND method request?

Returns: bool

isPut()

Is this a PUT method request?

Returns: bool

isTrace()

Is this a TRACE method request?

Returns: bool

isXmlHttpRequest()

Is the request a Javascript XMLHttpRequest?

Should work with Prototype/Script.aculo.us, possibly others.

Returns: bool

renderRequestLine()

Return the formatted request line (first line) for this http request

Returns: string

setAllowCustomMethods()

Parameter Name Type Description
$strictMethods bool

Returns:

setContent()

Set message content

Parameter Name Type Description
$value mixed

Returns: \Message

setFiles()

Provide an alternate Parameter Container implementation for file parameters in this object, (this is NOT the primary API for value setting, for that see getFiles())

Parameter Name Type Description
$files \ParametersInterface

Returns: $this

setHeaders()

Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders())

Parameter Name Type Description
$headers \Headers

Returns: $this

setMetadata()

Set message metadata

Non-destructive setting of message metadata; always adds to the metadata, never overwrites the entire metadata container.

Parameter Name Type Description
$spec string|int|array|\Traversable
$value mixed

Returns: \Message

setMethod()

Set the method for this request

Parameter Name Type Description
$method string

Returns: $this

setPost()

Provide an alternate Parameter Container implementation for post parameters in this object, (this is NOT the primary API for value setting, for that see getPost())

Parameter Name Type Description
$post \ParametersInterface

Returns: $this

setQuery()

Provide an alternate Parameter Container implementation for query parameters in this object, (this is NOT the primary API for value setting, for that see getQuery())

Parameter Name Type Description
$query \ParametersInterface

Returns: $this

setUri()

Set the URI/URL for this request, this can be a string or an instance of Laminas\Uri\Http

Parameter Name Type Description
$uri string|\HttpUri

Returns: $this

setVersion()

Set the HTTP version for this object, one of 1.0, 1.1 or 2 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2)

Parameter Name Type Description
$version string (Must

Returns: $this

toString()

Returns: string

Top